#ifndef UDP_ACCEPTOR_H
#define UDP_ACCEPTOR_H
#include "io_acceptor.h"
#include "udp_acceptor_config.h"
#ifdef _USING_ACE
#include "./detail/ace_udp_acceptor_impl.h"
#else 
#include "./detail/asio_udp_acceptor_impl.h"
#endif

namespace vpm
{
	namespace mina
	{
		class UdpAcceptor : public IoAcceptor
		{
		public:

			UdpAcceptor(UdpAcceptorConfig& config ,IoHandler& handler):m_udpService(config,handler)
			{

			}

			virtual void bind(ServiceUrl & address)
			{
				if (address.port != 0 )
				{
					m_udpService.bind(address.port);
				}		
			}

			virtual void unbind()
			{

			}

		private:
			UdpAcceptorImpl m_udpService; 
		};
	}
}


#endif // UDP_ACCEPTOR_H  
